from openpyxl import Workbook

wb = Workbook()
# 抓取工作表
ws = wb.active
# 数据分配给单元格
ws['A1'] = 'Hello'
# 列添加元素
ws.append([1, 2, 3])

from datetime import datetime
ws['A3'] = datetime.now()
# 保存文件
wb.save('test.xlsx')


